package com_djm_2025_05_15;

/**
 * @author dengjiangming
 * @version 1.0.0
 * @date 2025-05-15
 */

//求最大值方法的重载
public class Demo1 {

    public static int add(int num1,int num2){
        return num1+num2;
    }

    public static double add(double num1,double num2,double num3){
        return num1+num2+num3;
    }


//    在同一个类中定义多个方法：要求不仅可以求2个整数的最大值，还可以求3个小数的最大值
    public static void main(String[] args) {
        int num1 = 1;
        int num2 = 2;

        System.out.println(add(num1,num2));

        double doubleNum1 = 1.0;
        double doubleNum2 = 2.0;
        double doubleNum3 = 3.0;

        System.out.println(add(doubleNum1,doubleNum2,doubleNum3));
    }
}
